$(document).ready(function(){
    updateShoppingCartInformation();
    var user = getCurrentUser();
    if(user)
        $("#client").html("Cliente: " + user.name);
});

function updateShoppingCartInformation(){
    var total = getCartTotal();
    var quantity = getCartItemsQuantity();
    $("#quantity").html("Items: " + quantity);
    $("#total").html("$us.: " + total);
}

function addToCart(id, price){
    addItemToCart(id, price);
    updateShoppingCartInformation();
    return false;
}